home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15588 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: news.iwl.net!usenet
  2. From: "Gary L. Grobe" <glgrobe@iwl.net>
  3. Newsgroups: comp.lang.c++
  4. Subject: help with defining classes
  5. Date: Sun, 07 Apr 1996 01:11:09 -0600
  6. Organization: A poorly-installed InterNetNews site
  7. Message-ID: <31676A8D.1F95@iwl.net>
  8. NNTP-Posting-Host: p194.iwl.net
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (Win95; I)
  13.  
  14. I need a doubly linked list of pointers (refer to this as the parent
  15. list). Each pointer points to an object (refer to this as the node).
  16. Each node is to contain several other doubly linked list of objects
  17. (child list). I planned on making the parent list and child list using
  18. TIDoubleListImp but learned that I cannot use templates inside
  19. templates. Each elem of the child list is to be dynamically allocated.
  20.  
  21. Maybe I should not even be using a container class. I could define *next
  22. and *prev in each class and use member functions for list management but
  23. this is too textbook like and I would like to take advantage of and
  24. learn the more advanced features.
  25.  
  26. Can someone map an example class.
  27. Also, if using container classes, how do I declare this globally
  28. through out many files. I tried declaring a container as external in a
  29. main header and put it in a global.cpp file. I don't think I had the
  30. syntax right.
  31.  
  32.                 [][][][][][][] parent double link list
  33.                 ^ pointer to node object
  34.                 [] node object
  35.                /|\
  36.               / | \
  37.              /  |  \
  38.             /   |   \
  39.           [][]  [][] [][][][]
  40.           list  list   list
  41.           objA  objB   objC
  42.  
  43. objA, objB and objC have very little in common.
  44.  
  45. Any help is much appreciated!!!
  46.